<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

<c:if test="${canAddOrUpdate eq true}">
<div class="top-right-btn">
	<a href="course.pt">Create New Course</a>
</div>
</c:if>

<table class="list-results-table">
	<tbody>
		<tr>
			<th>Name</th>
			<th>Couse ID</th>
			<th>Department</th>
			<th width="10%">Created Date</th>
			<th width="15%">Last Updated Date</th>
		</tr>
		
		<c:forEach items="${courses}" var="course">
		<tr>
			<td><a href="course.pt?id=<c:out value="${course.id}"/>"><c:out value="${course.name}"/></a></td>
			<td><c:out value="${course.courseId}"/></td>
			<td><c:out value="${course.department.name}"/></tD>
			<td>
				<fmt:formatDate value="${course.createdDate}" pattern="dd-MM-yyyy"/>
			</td>
			<td>
				<fmt:formatDate value="${department.lastUpdatedDate}" pattern="dd-MM-yyyy"/>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>